/**
 * $Id$
 * Copyright 2009-2012 Oak Pacific Interactive. All rights reserved.
 */
package com.rabbit.base;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 *
 *
 * @author <a href="mailto:邮箱地址">姓名</a>
 * @version 2013-3-25上午10:40:09
 */
public abstract class TabFragment extends BaseFragment {

    public final String TAG = "com.quad.base.TabFragment";

    /**
     * @author yuehui 作用说明 ：标签fragment的类型
     */
    protected String tag;

    protected boolean isAdded = false;

    private TagsFragment mTabFragment;

    void setTabsFragment(TagsFragment tabsFragment) {
        this.mTabFragment = tabsFragment;
    }

    /**
     * @author yuehui 创建的日期 ：2013-3-25
     * @param inflater
     * @param rootView
     * @return 作用说明 ：获取tabbar中的view
     */
    public abstract View getTableView(Context context, LayoutInflater inflater, View rootView);

    /**
     * @author yuehui 创建的日期 ：2013-3-25
     * @return 作用说明 ：返回title的mode
     */
//    public abstract CommonTitleMode getTitleMode(CommonTitleView titleView);

    /**
     * @author yuehui 创建的日期 ：2013-3-25 作用说明 ：当前tabbar被选中时
     */
    protected void onSelect(View tabView) {

    }

    protected void onUnSelect(View tabView) {

	}

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        isAdded = false;
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
    }

    public void showTabBar() {
        if (mTabFragment == null) {
            return;
        }
        mTabFragment.showTabBar();
    }

    public void hiddenBar() {
        if (mTabFragment == null) {
            return;
        }
        mTabFragment.hiddenTabBar();
    }

}
